dados <- read.csv2("Base de Dados.csv") # importação dos dados

colnames(dados) # nome das colunas (variáveis)
attach(dados)
### TABELA 1
table(Classificacao, Year)


### TABELA 3
# variáveis quantitativas
sapply(dados[,c(8:10,15)],length) # número de observações
sapply(dados[,c(8:10,15)], mean) # média
sapply(dados[,c(8:10,15)], sd) # desvio padrão
sapply(dados[,c(8:10,15)], sd)/sapply(dados[,c(8:10,15)], mean) # cv
sapply(dados[,c(8:10,15)], median) # mediana
sapply(dados[,c(8:10,15)], min) # mínimo
sapply(dados[,c(8:10,15)], max) # máximo
table(IDEN_ACION) # frequência absoluta da identidade dos acionistas
prop.table(table(IDEN_ACION)) # frequência relativa da identidade dos acionistas

### TABLEA 4
tapply(compensation_benefits, Year, mean)
tapply(diversity_labor_rights, Year, mean)
tapply(training_health_safety, Year, mean)
tapply(CPROP, Year, mean)
table(Year, IDEN_ACION)


### TABELA 5
tapply(compensation_benefits, IDEN_ACION, mean)
tapply(compensation_benefits, IDEN_ACION, sd)
tapply(compensation_benefits, IDEN_ACION, min)
tapply(compensation_benefits, IDEN_ACION, median)
tapply(compensation_benefits, IDEN_ACION, max)
oneway.test(compensation_benefits ~ IDEN_ACION)
pairwise.t.test(compensation_benefits, IDEN_ACION)

tapply(diversity_labor_rights, IDEN_ACION, mean)
tapply(diversity_labor_rights, IDEN_ACION, sd)
tapply(diversity_labor_rights, IDEN_ACION, min)
tapply(diversity_labor_rights, IDEN_ACION, median)
tapply(diversity_labor_rights, IDEN_ACION, max)
oneway.test(diversity_labor_rights ~ IDEN_ACION)
pairwise.t.test(diversity_labor_rights, IDEN_ACION)

tapply(training_health_safety, IDEN_ACION, mean)
tapply(training_health_safety, IDEN_ACION, sd)
tapply(training_health_safety, IDEN_ACION, min)
tapply(training_health_safety, IDEN_ACION, median)
tapply(training_health_safety, IDEN_ACION, max)
oneway.test(training_health_safety ~ IDEN_ACION)
pairwise.t.test(training_health_safety, IDEN_ACION)

